package org.ourgrid.broker.communication.sender;

import org.ourgrid.common.interfaces.to.JobEndedInterested;
import org.ourgrid.common.internal.SenderIF;
import org.ourgrid.common.internal.response.LocalWorkerProviderReleaseResponseTO;

import br.edu.ufcg.lsd.commune.container.servicemanager.ServiceManager;
import br.edu.ufcg.lsd.commune.identification.ServiceID;

public class JobEndedInterestedReleaseSender implements SenderIF<LocalWorkerProviderReleaseResponseTO> {

	public void execute(LocalWorkerProviderReleaseResponseTO response,
			ServiceManager manager) {
		ServiceID serviceID = ServiceID.parse(response.getStubAddress());
		
		JobEndedInterested jobEndedInterested = (JobEndedInterested) manager.getStub(serviceID, JobEndedInterested.class);
		
		manager.release(jobEndedInterested);
	}

}
